'''
    ESP8266/ESP32 neopixel 16x16 image display demo

    Author: shaoziyang
    Date:   2018.2

    http://www.micropython.org.cn

'''
from machine import Pin
import time

from neo16x16_img import neo16x16_img

np = neo16x16_img(Pin(2))

npdat=[
0x2AF3AF, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x6CF000, 0x39F19F, 
0x06F000, 0x5CF29F, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x5CF000, 0x07F2AF, 0x00014E, 
0x000000, 0x06F16E, 0x6CF2AF, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x6DF000, 0x06F29F, 0x00004E, 0x000000, 
0x000000, 0x36E000, 0x07F05F, 0x5DF2AF, 
0x0005EF, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x5CF000, 
0x08F29F, 0x14A06F, 0x000000, 0x000000, 
0x000000, 0x000000, 0x26E000, 0x08F05F, 
0x6CF19F, 0x000000, 0x000000, 0x000000, 
0x000000, 0x5B76CA, 0x000000, 0x08F4BC, 
0x25D05F, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x26F000, 
0x4B839F, 0x5A45A3, 0x0007C8, 0x000000, 
0x8A7000, 0x5C85A6, 0x7B75B5, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x6A76B8, 0x6A75B7, 0x8A6695, 
0x000000, 0x5A76C9, 0x8B8594, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x6DA8CA, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x121145, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x169156, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x234000, 
0x15818B, 0x000217, 0x000000, 0x000000, 
0x000000, 0x000000, 0x129000, 0x0AE17B, 
0x000169, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x19C301, 
0x24709C, 0x00013A, 0x000000, 0x000000, 
0x000000, 0x000000, 0x116000, 0x169237, 
0x24718B, 0x245169, 0x000000, 0x000000, 
0x000000, 0x235000, 0x0CF09D, 0x1590AE, 
0x159159, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x17C149, 
0x09D18C, 0x0BF0BE, 0x23519C, 0x000234, 
0x000000, 0x17B000, 0x16B15C, 0x14817C, 
0x000024, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x002013, 
0x012000, 0x11A126, 0x000116, 0x000000, 
0x000000, 0x000000, 0x000000, 0x048012, 
0x16B149, 0x12716A, 0x000000, 0x000000, 
0x000000, 0x12811B, 0x147247, 0x09E16A, 
0x15B09D, 0x00010A, 0x000000, 0x000000, 
0x000000, 0x000000, 0x16C127, 0x0BE08D, 
0x17A0BF, 0x18B09C, 0x13A17A, 0x000227, 
0x214000, 0x0AE17A, 0x1680AE, 0x0AD235, 
0x0BE0BF, 0x00009C, 0x000000, 0x000000, 
0x000000, 0x000000, 0x236235, 0x158246, 
0x000245, 0x246312, 0x18B168, 0x200145, 
0x122FFF, 0x000123, 0x000000, 0x000000, 
0x000000, 0x235000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x9FF9FF, 
0x9FF9FF, 0x0009FF, 0x000000, 0x000000, 
0x000000, 0x9FF000, 0x0CF9FF, 0x0CF0CF, 
0x0CF0CF, 0x9FF9FF, 0x000000, 0x000000, 
0x000000, 0x9FF000, 0x0CF0CF, 0x0CF0CF, 
0x0CF0CF, 0x0CF0CF, 0x9FF0CF, 0x000000, 
0x9FF000, 0x0CF0CF, 0x0CF0CF, 0x0CF0CF, 
0x0CF0CF, 0x0CF0CF, 0x9FF0CF, 0x000000, 
0x000000, 0x0CF9FF, 0x0CF0CF, 0x0CF0CF, 
0x0CF0CF, 0x0CF0CF, 0x0CF0CF, 0x0009FF, 
0x0CF9FF, 0x0CF0CF, 0x0CF0CF, 0x0CF0CF, 
0x0CF0CF, 0x0CF0CF, 0x0CF0CF, 0x0009FF, 
0x9FF000, 0x0CF0CF, 0x0CF0CF, 0x0CF0CF, 
0x0CF0CF, 0x0CF0CF, 0x0CF0CF, 0x9FF0CF, 
0x0CF9FF, 0x0CF0CF, 0x0CF0CF, 0x0000FF, 
0x0CF0FF, 0x0CF0CF, 0x0CF0CF, 0x0009FF, 
0x9FF000, 0x0CF0CF, 0x0CF0CF, 0x0FF0CF, 
0x0FF000, 0x0CF0CF, 0x0CF0CF, 0x9FF0CF, 
0x0CF9FF, 0x0CF0CF, 0x0FF0CF, 0x000000, 
0x0FF000, 0x0CF0CF, 0x0CF0CF, 0x0009FF, 
0x000000, 0x0CF9FF, 0x0CF0CF, 0x0000FF, 
0x000000, 0x0CF0FF, 0x0CF000, 0x0009FF, 
0x9FF000, 0x0CF0CF, 0x0FF0CF, 0x000000, 
0x0FF000, 0x0CF0CF, 0x9FF0CF, 0x000000, 
0x000000, 0x9FF000, 0x0CF0CF, 0x0000FF, 
0x000000, 0x0CF0FF, 0x9FF0CF, 0x000000, 
0x000000, 0x9FF000, 0x0009FF, 0x000000, 
0x000000, 0x9FF9FF, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0xEEE000, 0xFC9FC9, 
0xFC9FC9, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9000, 0xFC9FC9, 
0xFC9FC9, 0xEEEFC9, 0x000000, 0x000000, 
0x000000, 0xAAA000, 0x555FC9, 0x000000, 
0x333000, 0xEEEFC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9FC9, 0x000000, 
0x000F90, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0xF99000, 
0x000000, 0xFC9FC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xFC9FC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xFC9FC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xFC9000, 0x000FC9, 0xF99000, 
0x000000, 0xFC9FC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9FC9, 0x000000, 
0x000F90, 0xFC9000, 0x000FC9, 0x000000, 
0x000000, 0xBBB000, 0x333FC9, 0x000000, 
0x111000, 0xEEEFC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9000, 0xFC9FC9, 
0xFC9FC9, 0xFC9FC9, 0x000000, 0x000000, 
0x000000, 0x000000, 0xFC9000, 0xFC9FC9, 
0xFC9FC9, 0x000000, 0x000000, 0x000000, 
] 

n = 0
while 1:
    np.show(npdat, n)
    n = (n+16)%64
    time.sleep_ms(1000)

